package com.haidong.dao.impl;

import com.haidong.dao.BookDao;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class BookDaoImpl implements BookDao, InitializingBean, DisposableBean {
    private int insertNum;
    private String insertStr;

    public void setInsertNum(int insertNum) {
        this.insertNum = insertNum;
    }

    public void setInsertStr(String insertStr) {
        this.insertStr = insertStr;
    }

    @Override
    public void save() {
        System.out.println("book Dao save ...");
        System.out.println(insertStr + insertNum);
    }
    // 写好bean的初始化和销毁的操作
    public void init(){
        System.out.println("dao初始化");
    }
    @Override
    public void destroy() {
        System.out.println("destroy Dao");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("dao初始化");
    }
}
